var numList1 =10 ;	//每页列数
var curPage1 = 1;  //默认第一页
var subPage1=0;  //批量显示添加默认落点
var totalPage1=9; //最多显示分页数
var selectJsonData1 = "";
var countPage1 = 0;//页数总计
function jsCk(t){
	if(!/^[1-9][0-9]*$/g.test(t.value)){
		t.value="";
		return false;
	}
}
var paging1 = {
  		//加载分页
  		"loadPage1":function(data){
	  		 	var pCount = data.totalPages;//页数
	  			countPage1 = pCount;
	  			var pNums =  data.totalRecords;//总计条数
				var s1 = (totalPage1-1)/2;
				var start_page = curPage1 - s1;
				var end_page = curPage1 + s1;
				if(start_page<=0){
					end_page = end_page - start_page + 1;
					start_page = 1;
					}
				if(end_page>pCount){
					end_page = pCount;
					}	  		
	  			 var prevHtml ='<a toPage="'+(curPage1-1)+'" href="javascript:void(0);"   class="str">&lt;</a>';
	  			 var nextHtml ='<a toPage="'+(curPage1+1)+'" href="javascript:void(0);"  class="end" >&gt;</a>';
	  			 if(curPage1<2)prevHtml="";
	  			 if(curPage1>=pCount)nextHtml="";
	  			 var ppHtml = "";
	  			 for(i=start_page;i<=end_page;i++){
	  			    var cur = "";
	  			    if(curPage1==i)cur='class="cur"';
		  			ppHtml = ppHtml+'<a toPage="'+i+'" href="javascript:void(0);"  '+cur+'>'+i+'</a>';
	  			 }
	  			 var pageHtml = '<span class="ic fl pr20 pCount">共<b>'+pNums+'</b>条记录</span><span class="gopg fr"><span class="fl">跳转到</span><input type="button" class="btn" value="go"><input type="text" min="1" class="txt" onkeyup="jsCk(this)"></span><div class="pg fr pNumBtn">'+prevHtml+ppHtml+nextHtml+'</div>';
	  			 var pageArea1 = $('#pageArea1');
	  			 pageArea1.html(pageHtml);
	  			
	  			//每页显示指定的数量
	  			var dd = pNums/10;
	  			var ddHtmls = "";
	  			var pCur = 0;
	  			if(pNums>0&&pNums<11){
	  				pCur=3;
	  				pageArea1.show();
	  			}else if(pNums>10&&pNums<21){
	  				pCur=2;
	  				pageArea1.show();
	  			}else if(pNums>20&&pNums<51){
	  				pCur=1;
	  				pageArea1.show();
	  			}else if(pNums>50&&pNums<101){
	  				pCur=0;
	  				pageArea1.show();
	  			}else if(pNums==0){
	  				pCur=4;
	  				pageArea1.hide();
	  			}
	  			//$("#pageArea1 .columnsPage").html("显示 <a href='javascript:void(0);'>10</a><a href='javascript:void(0);'>20</a><a href='javascript:void(0);'>50</a><a href='javascript:void(0);'>100</a>");
	  			
	  			//$("#pageArea1 .columnsPage a").removeClass("cur").eq(subPage1).addClass("cur");
	  			var s = 3; 
	  			for(var i=0;i<pCur;i++){
	  				$("#pageArea1 .columnsPage a").eq(s).remove();
	  				s -=1;
	  			}
	  			
		}
}


 

